package v1

import (
	websocket "gitee.com/carlzyhuang/framework/rpc/websocket"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// GreeterWsServer defines service
type GreeterWsServer interface {
	SayHello(ctx websocket.SessionContext, req *HelloRequest) (rsp *HelloReply, err error)
	mustEmbedUnimplementedGreeterWsServer()
}

// UnimplementedGreeterWsServer must be embedded to have
// forward compatible implementations.
type UnimplementedGreeterWsServer struct {
}

func (UnimplementedGreeterWsServer) SayHello(ctx websocket.SessionContext, req *HelloRequest) (*HelloReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
}

func (UnimplementedGreeterWsServer) mustEmbedUnimplementedGreeterWsServer() {}

func RegisterGreeterWsServer(s websocket.ServiceRegistrar, srv GreeterWsServer) {
	s.RegisterService(&GreeterWsServer_ServiceDesc, srv)
}

// _GreeterWsServer_SayHello_Handler SayHello
func _GreeterWsServer_SayHello_Handler(svr interface{}, ctx websocket.SessionContext, dec func(any) error) (response any, err error) {
	in := new(HelloRequest)
	if err := dec(in); err != nil {
		return nil, err
	}

	return svr.(GreeterWsServer).SayHello(ctx, in)
}

// GreeterWsServer_ServiceDesc descriptor for RegisterService)
var GreeterWsServer_ServiceDesc = websocket.ServiceDesc{
	ServiceName: "helloworld.v1.Greeter",
	HandlerType: (*GreeterWsServer)(nil),
	Methods:     []websocket.MethodDesc{},
}

// 请求协议号定义
const ()

// WsGreeterWsServer defines service
type WsGreeterWsServer interface {
	SayHello(ctx websocket.SessionContext, req *HelloRequest) (rsp *HelloReply, err error)
	mustEmbedUnimplementedWsGreeterWsServer()
}

// UnimplementedWsGreeterWsServer must be embedded to have
// forward compatible implementations.
type UnimplementedWsGreeterWsServer struct {
}

func (UnimplementedWsGreeterWsServer) SayHello(ctx websocket.SessionContext, req *HelloRequest) (*HelloReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
}

func (UnimplementedWsGreeterWsServer) mustEmbedUnimplementedWsGreeterWsServer() {}

func RegisterWsGreeterWsServer(s websocket.ServiceRegistrar, srv WsGreeterWsServer) {
	s.RegisterService(&WsGreeterWsServer_ServiceDesc, srv)
}

// _WsGreeterWsServer_SayHello_Handler SayHello
func _WsGreeterWsServer_SayHello_Handler(svr interface{}, ctx websocket.SessionContext, dec func(any) error) (response any, err error) {
	in := new(HelloRequest)
	if err := dec(in); err != nil {
		return nil, err
	}

	return svr.(WsGreeterWsServer).SayHello(ctx, in)
}

// WsGreeterWsServer_ServiceDesc descriptor for RegisterService)
var WsGreeterWsServer_ServiceDesc = websocket.ServiceDesc{
	ServiceName: "helloworld.v1.WsGreeter",
	HandlerType: (*WsGreeterWsServer)(nil),
	Methods: []websocket.MethodDesc{
		{
			MethodName: "/helloworld.v1.WsGreeter/SayHello",
			MessageID:  1001,
			Handler:    _WsGreeterWsServer_SayHello_Handler,
		},
	},
}

// 请求协议号定义
const (
	CMD_WsGreeter_SayHello = 1001
)

// TestWsServer defines service
type TestWsServer interface {
	Testing(ctx websocket.SessionContext, req *HelloRequest) (rsp *HelloReply, err error)
	mustEmbedUnimplementedTestWsServer()
}

// UnimplementedTestWsServer must be embedded to have
// forward compatible implementations.
type UnimplementedTestWsServer struct {
}

func (UnimplementedTestWsServer) Testing(ctx websocket.SessionContext, req *HelloRequest) (*HelloReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Testing not implemented")
}

func (UnimplementedTestWsServer) mustEmbedUnimplementedTestWsServer() {}

func RegisterTestWsServer(s websocket.ServiceRegistrar, srv TestWsServer) {
	s.RegisterService(&TestWsServer_ServiceDesc, srv)
}

// _TestWsServer_Testing_Handler Testing
func _TestWsServer_Testing_Handler(svr interface{}, ctx websocket.SessionContext, dec func(any) error) (response any, err error) {
	in := new(HelloRequest)
	if err := dec(in); err != nil {
		return nil, err
	}

	return svr.(TestWsServer).Testing(ctx, in)
}

// TestWsServer_ServiceDesc descriptor for RegisterService)
var TestWsServer_ServiceDesc = websocket.ServiceDesc{
	ServiceName: "helloworld.v1.Test",
	HandlerType: (*TestWsServer)(nil),
	Methods:     []websocket.MethodDesc{},
}

// 请求协议号定义
const ()
